/**
 * Free software.
 */

package org.nanhill.moo.service.impl;

import org.nanhill.moo.dao.CostDao;
import org.nanhill.moo.domain.Cost;
import org.nanhill.moo.service.CostService;

/**
 * @author alin [xalinx at gmail dot com]
 * @date 2006-10-23
 */
public class CostServiceImpl extends AbstractService implements CostService {

	private CostDao costDao;

	public void setCostDao(CostDao costDao) {
		this.costDao = costDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.nanhill.moo.service.CostService#load(long)
	 */
	public Cost load(int cid) {
		return costDao.findById(cid);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.nanhill.moo.service.CostService#loadAndInitCostsOrderByCount()
	 */
	public Cost[] loadAllWithFavorCount() {;
		return costDao.findAllWithFavorCount();
	}

	public Cost[] loadAll() {
		return costDao.findAllToArray();
	}

}
